
import 'package:dio/dio.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';

class ErrorInterceptor extends Interceptor{

  @override
  void onError(DioError err, ErrorInterceptorHandler handler) {
    print("拦截错误");
    print(err);
    handler.reject(err);
    EasyLoading.showToast('服务器异常，请稍后重试!');
  }

  ErrorInterceptor();
}